package com.itheima.health.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.health.common.MessageConst;
import com.itheima.health.entity.PageResult;
import com.itheima.health.entity.QueryPageBean;
import com.itheima.health.entity.Result;
import com.itheima.health.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * @Description:
 * @Date: 2020-8-26 17:09
 * @Auther: 王肖
 */
@RestController
@RequestMapping("order")
@Slf4j
public class OrderController {


    @Reference
    private OrderService orderService;


    @RequestMapping("orderList")
    public Result orderList(@RequestBody QueryPageBean queryPageBean){


        log.info("[预约订单列表]data:{}",queryPageBean);
        PageResult pageResult = orderService.findByPage(queryPageBean, queryPageBean.getOrderDate());

        log.info("pageResult:{}",pageResult);
        return new Result(true,"查询预约订单成功",pageResult);
    }
}
